/**
 * Created by novem on 15/9/25.
 */
window.onload=function(){
    //��ͷ����
    var mySwiper1 = new Swiper('#w_thua',{
        freeMode : true,
        slidesPerView : 'auto'
        // loop : true,
    });
    var url = getUrl();
    var spotsId = $.getUrlParam('spotsId');
    var id=$.getUrlParam('id');
    var spotsId=$.getUrlParam('spotsId');
    $.jsonp({
        url: 'http://'+url+'/api/spotsphoto/spotsphoto_detail-'+id,
        data: {},
        callbackParameter: "callback",
        success: function (data, textStatus, xOptions) {
            var unixTimestamp = new Date(data.spots.createTime * 1000);
            data.spots.createTime = unixTimestamp.toLocaleString();
            var complied_tpl1 = juicer($("#top_tpl").text());
            var html1 = complied_tpl1.render(data);
            $(".ui-header").append(html1);
            var complied_tpl = juicer($("#jingdian_tpl").text());
            var html = complied_tpl.render(data);
            $(".order-list").append(html);
        },
        error: function (xOptions, textStatus) {}
    });
}

function jump(url){
    var spotsId = $.getUrlParam('id');
    location.href=url+'?id='+spotsId
}

function getTime(t){
    var nt = t*1000;
    var n = new Date(nt);
    return formatDate(n);
}
function formatDate(now)   {
    var   year=now.getFullYear();
    var   month=now.getMonth()+1;
    var   date=now.getDate();
    return   year+"-"+(month>=10?month:"0"+month)+"-"+(date>=10?date:"0"+date);
}
